<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommodityClassifysTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('commodity_classifys', function (Blueprint $table) {
            $table->increments('commodity_classify_id')->comment("商品分类ID,自增");
            $table->string('classify_name',50)->comment("商品分类名");
            $table->string('classify_index_img')->default('')->comment("商品分类的展示图(顶级分类没有)");
            $table->integer('parent_id')->default(0)->comment("父级分类ID");
            $table->engine = 'InnoDB';
            $table->index('parent_id');
//            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('commodity_classifys');
    }
}
